<?php


namespace app\api\validate;


use think\Validate;

class User extends Validate
{
    protected $rule = [
        'username' => 'require',
        'phone_number' => 'require',
        'code' => 'require|number|min:4',
        'type' => "require"
    ];

    protected $message = [
        'username.require' => '用户名不能为空',
        'phone_number.require' => '电话号码不能为空',
        'code.require' => "短信验证码必填",
        'code.number' => '验证码必须为数字',
        'code.min' => '验证码不得低于4位',
        'type.require'=>'类型必填'
    ];
    protected $scene = [
        'send_code' => ['phone_number'],
        'login' => ['phone_number','code','type']
    ];
}